730bf26ce29352e122d4b79af523394b87c92d8f,oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/StringValue.java,StringValue,getValue,#number#,61
Before Change
String inputValue = type == PropertyType.NAME ?
namePathMapper.getOakName(value) :
type == PropertyType.PATH ?
namePathMapper.getOakPath(value) :
value;
return ValueHelper.deserialize(inputValue, type, false, valueFactory);
}
After Change
@Override @SuppressWarnings("deprecation")
public Value getValue(int type) throws RepositoryException {
if (type == PropertyType.BINARY) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
Base64.decode(value, baos);
return valueFactory.createValue(
new ByteArrayInputStream(baos.toByteArray()));
} catch (IOException e) {
throw new RepositoryException(
"Failed to decode binary value: " + value, e);
}
}
// The ValueFactory instance takes care of name and path mapping
// from JCR to Oak values, but here we need an additional level of
// mapping for XML to JCR values.
String jcrValue;
if (type == PropertyType.NAME) {
jcrValue = namePathMapper.getOakName(value);
} else if (type == PropertyType.PATH) {
jcrValue = namePathMapper.getOakPath(value);
} else {
jcrValue = value;
}